---
sidebar_position: 4
toc_min_heading_level: 2
toc_max_heading_level: 2
---

# getDesignatedFriendsInfo

## 功能介绍

:::info 说明

通过关键词搜索好友

:::

<Tabs
groupId="sdks-language"
values={[
{ label: 'iOS', value: 'iOS', },
{ label: 'Android', value: 'Android', },
{ label: 'Flutter', value: 'Flutter', },
{ label: 'Uniapp', value: 'Uniapp', },
{ label: 'Web', value: 'Web', },
]
}>

<TabItem value="Flutter">

### 参数详解

</TabItem>

<TabItem value="iOS">

### 函数原型

```swift showLineNumbers

- (void)searchFriends:(OIMSearchUserParam *)searchParam
            onSuccess:(nullable OIMSearchUsersInfoCallback)onSuccess
            onFailure:(nullable OIMFailureCallback)onFailure;

```

### 输入参数

| 参数名称    | 参数类型                                                         | 是否必填 | 描述     |
| ----------- | ---------------------------------------------------------------- | -------- | -------- |
| searchParam | [OIMSearchUserParam](docs/sdks/Class/Friend/SearchUserParam.mdx) | 是       | 搜索参数 |

### 返回结果

| 参数名称  | 参数类型                                             | 描述     |
| --------- | ---------------------------------------------------- | -------- |
| onSuccess | NSArray<OIMSearchUserInfo \*>                        | 成功返回 |
| onFailure | [OIMFailureCallback](docs/sdks/Callback/onError.mdx) | 失败返回 |

### 代码示例

```swift showLineNumbers

OIMSearchUserParam *param = [OIMSearchUserParam new];
param.keywordList = @[];
param.isSearchRemark = YES;
param.isSearchUserID = YES;

[OIMManager.manager searchFriends:param
                      onSuccess:^(NSArray<OIMSearchUserInfo *> * _Nullable usersInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];

```

</TabItem>

<TabItem value="Android">

### 参数详解

</TabItem>

<TabItem value="Web">

### 参数详解

</TabItem>

<TabItem value="Uniapp">

### 参数详解

| 参数名称    | 参数类型 | 是否必填 | 描述                                 |
| ----------- | -------- | -------- | ------------------------------------ | --- |
| operationID | string   | 是       | 唯一随机字符串，用于根据日志定位问题 |
| userID      | string   | 是       | IM 用户 userID                       |
| token       | string   | 是       | IM 用户 token                        |     |

### 返回模板

```
Promise<void>
```

### 代码示例

```js showLineNumbers
import IMSDK from '@openim-sdk/uniapp-polyfill';

await IMSDK.API.login(IMSDK.uuidv4(), userID, token);
```

</TabItem>

</Tabs>
